package com.situ.mall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.situ.mall.pojo.entity.product.Carousel;
import com.situ.mall.pojo.entity.product.Category;
import com.situ.mall.product.mapper.CarouselMapper;
import com.situ.mall.product.service.ICarouselService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Sun Huijuan
 * @since 2024-10-09
 */
@Service
public class CarouselServiceImpl extends ServiceImpl<CarouselMapper, Carousel> implements ICarouselService {
	
	@Override
	public List<Carousel> listPortal() {
		QueryWrapper<Carousel> queryWrapper = new QueryWrapper<>();
		queryWrapper.orderByAsc("priority");
		queryWrapper.eq("status",1);
		queryWrapper.last("limit 4");
		List<Carousel> list = baseMapper.selectList(queryWrapper);
		return list;
	}
}
